#include "FactorySimple.h"
#include "..\CarAudi.h"
#include "..\CarByd.h"
#include "..\CarBMW.h"


//创建车;
InterfaceCar* FactorySimple::CreateCar(EnumCar typeCar)
{
    switch (typeCar)
    {
        case emCarByd:
        {
            return  new CarByd();
        }
        break;
        case emCarBMW:
        {
            return  new CarBMW();
        }
        break;
        case emCarAudi:
        {
            return  new CarAudi();
        }
        break;
        default:
        break;
    }

    return nullptr;
}

///////////////////////////////////////////////////////////
//变种，静态工厂;
//创建比亚迪车;
InterfaceCar* FactorySimple::CreateCarByd()
{
    return  new CarByd();
}

//创建奥迪车;
InterfaceCar* FactorySimple::CreateCarAdui()
{
    return  new CarAudi();
}

//创建宝马车;
InterfaceCar* FactorySimple::CreateCarBMW()
{
    return  new CarBMW();
}
